home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 6: Level 6 / 17 Bit - Level 6 (1998)(Epic Marketing)[!].iso / quartz / q1082.dms / q1082.adf / src.lzh / Fig / list.c < prev    next >
C/C++ Source or Header  |  1991-07-18  |  3KB  |  173 lines

  1. /* 
  2.  *    FIG : Facility for Interactive Generation of figures
  3.  *
  4.  *    Copyright (c) 1988 by Supoj Sutanthavibul (supoj@sally.UTEXAS.EDU)
  5.  *    Febuary 1988.
  6.  *
  7.  *    %W%    %G%
  8. */
  9. #include "fig.h"
  10. #include "object.h"
  11.  
  12. delete_arc(arc_list, arc)
  13. F_arc    **arc_list, *arc;
  14. {
  15.     F_arc    *a, *aa;
  16.  
  17.     if (*arc_list == NULL) return;
  18.     if (arc == NULL) return;
  19.  
  20.     for (a = aa = *arc_list; aa != NULL; a = aa, aa = aa->next) {
  21.         if (aa == arc) {
  22.         if (aa == *arc_list)
  23.             *arc_list = (*arc_list)->next;
  24.         else
  25.             a->next = aa->next;
  26.         break;
  27.         }
  28.         }
  29.     arc->next = NULL;
  30.     }
  31.  
  32. delete_ellipse(ellipse_list, ellipse)
  33. F_ellipse    **ellipse_list, *ellipse;
  34. {
  35.     F_ellipse    *q, *r;
  36.  
  37.     if (*ellipse_list == NULL) return;
  38.     if (ellipse == NULL) return;
  39.  
  40.     for (q = r = *ellipse_list; r != NULL; q = r, r = r->next) {
  41.         if (r == ellipse) {
  42.         if (r == *ellipse_list)
  43.             *ellipse_list = (*ellipse_list)->next;
  44.         else
  45.             q->next = r->next;
  46.         break;
  47.         }
  48.         }
  49.     ellipse->next = NULL;
  50.     }
  51.  
  52. delete_line(line_list, line)
  53. F_line    *line, **line_list;
  54. {
  55.     F_line    *q, *r;
  56.  
  57.     if (*line_list == NULL) return;
  58.     if (line == NULL) return;
  59.  
  60.     for (q = r = *line_list; r != NULL; q = r, r = r->next) {
  61.         if (r == line) {
  62.         if (r == *line_list)
  63.             *line_list = (*line_list)->next;
  64.         else
  65.             q->next = r->next;
  66.         break;
  67.         }
  68.         }
  69.     line->next = NULL;
  70.     }
  71.  
  72. delete_spline(spline_list, spline)
  73. F_spline    **spline_list, *spline;
  74. {
  75.     F_spline    *q, *r;
  76.  
  77.     if (*spline_list == NULL) return;
  78.     if (spline == NULL) return;
  79.  
  80.     for (q = r = *spline_list; r != NULL; q = r, r = r->next) {
  81.         if (r == spline) {
  82.         if (r == *spline_list)
  83.             *spline_list = (*spline_list)->next;
  84.         else
  85.             q->next = r->next;
  86.         break;
  87.         }
  88.         }
  89.     spline->next = NULL;
  90.     }
  91.  
  92. delete_text(text_list, text)
  93. F_text    **text_list, *text;
  94. {
  95.     F_text    *q, *r;
  96.  
  97.     if (*text_list == NULL) return;
  98.     if (text == NULL) return;
  99.  
  100.     for (q = r = *text_list; r != NULL; q = r, r = r->next) 
  101.         if (r == text) {
  102.         if (r == *text_list)
  103.             *text_list = text->next;
  104.         else
  105.             q->next = text->next;
  106.         break;
  107.         }
  108.     text->next = NULL;
  109.     }
  110.  
  111. delete_compound(list, compound)
  112. F_compound    **list, *compound;
  113. {
  114.     F_compound    *c, *cc;
  115.  
  116.     if (*list == NULL) return;
  117.     if (compound == NULL) return;
  118.  
  119.     for (cc = c = *list; c != NULL; cc = c, c = c->next) {
  120.         if (c == compound) {
  121.         if (c == *list)
  122.             *list = (*list)->next;
  123.         else
  124.             cc->next = c->next;
  125.         break;
  126.         }
  127.         }
  128.     compound->next = NULL;
  129.     }
  130.  
  131. insert_arc(arc_list, a)
  132. F_arc    **arc_list, *a;
  133. {
  134.     a->next = *arc_list;
  135.     *arc_list = a;
  136.     }
  137.  
  138. insert_ellipse(ellipse_list, e)
  139. F_ellipse    **ellipse_list, *e;
  140. {
  141.     e->next = *ellipse_list;
  142.     *ellipse_list = e;
  143.     }
  144.  
  145. insert_line(line_list, l)
  146. F_line    **line_list, *l;
  147. {
  148.     l->next = *line_list;
  149.     *line_list = l;
  150.     }
  151.  
  152. insert_spline(spline_list, s)
  153. F_spline    **spline_list, *s;
  154. {
  155.     s->next = *spline_list;
  156.     *spline_list = s;
  157.     }
  158.  
  159. insert_text(text_list, t)
  160. F_text    **text_list, *t;
  161. {
  162.     t->next = *text_list;
  163.     *text_list = t;
  164.     }
  165.  
  166.  
  167. insert_compound(list, c)
  168. F_compound    **list, *c;
  169. {
  170.     c->next = *list;
  171.     *list = c;
  172.     }
  173.